package com.zjitc.service.impl;
import com.zjitc.dao.UsersDao;
import com.zjitc.po.User;
import com.zjitc.service.UserService;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/3/28 14:56
 * @description:
 */

//实现类
@Service
public class UserServiceImpl implements UserService {

  @Autowired
  private UsersDao usersDao;


  @Override
  public int addEmps() {

    List<User> userList = new ArrayList<>();

    for (int i=0;i<=150000;i++){
      User user =new User();
      int count =new Random().nextInt(100-0+1)+0;
      user.setAge(count);
      if(i%2==0){
        user.setSex("M");
      }else{
        user.setSex("G");
      }
      userList.add(user);
    }
    int abc=usersDao.addEmps(userList);
    return abc;
  }
}
